package com.start.shop.modules.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.start.shop.modules.repository.dao.UserDao;
import com.start.shop.modules.repository.entity.User;
import com.start.shop.modules.service.IUserService;

@Service
public class UserServiceImpl implements IUserService {

	@Autowired
	UserDao userDao;
	
	//根据openId获取客户信息
	@Override
	public User getUserByOpenId(String openId) {
		return userDao.selectUserByOpenId(openId);
	}
	
	//根据客户id获取客户信息
	@Override
	public User getUserById(int id) {
		return userDao.selectUserById(id);
	}

	@Override
	public void insert(User user) {
		userDao.insert(user);
	}

	@Override
	public int setUserAgent(int userId, int agentId) {
		userDao.updateUserAgent(userId, agentId);
		return 0;
	}

	
}
